package com.ruoyi.rocky.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * 实体类 店铺表
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
@TableName("pc_store")
@ApiModel(value = "PcStore", description = "店铺表")
@AllArgsConstructor
public class PcStore extends BaseEntity {

  private static final long serialVersionUID = 1L;

  @ApiModelProperty(value = "店铺id")
  private Long id;

  @ApiModelProperty(value = "会员id")
  @TableField(value = "mid")
  private Long mid;

  /**
   * 店铺名称
   */
  @ApiModelProperty(value = "店铺名称")
  @Length(max = 200, message = "店铺名称长度不能超过200")
  @TableField(value = "store_name", condition = LIKE)
  private String storeName;

  /**
   * logo
   */
  @ApiModelProperty(value = "logo")
  @Length(max = 500, message = "logo长度不能超过500")
  @TableField(value = "logo", condition = LIKE)
  private String logo;

  /**
   * 发货地址
   */
  @ApiModelProperty(value = "发货地址")
  @Length(max = 500, message = "发货地址长度不能超过500")
  @TableField(value = "ship_address", condition = LIKE)
  private String shipAddress;

  /**
   * 店铺简介
   */
  @ApiModelProperty(value = "店铺简介")
  @Length(max = 500, message = "店铺简介长度不能超过500")
  @TableField(value = "brief", condition = LIKE)
  private String brief;

  /**
   * 注册手机号
   */
  @ApiModelProperty(value = "注册手机号")
  @NotEmpty(message = "注册手机号不能为空")
  @Length(max = 32, message = "注册手机号长度不能超过32")
  @TableField(value = "mobile", condition = LIKE)
  private String mobile;

  /**
   * 退货地址
   */
  @ApiModelProperty(value = "退货地址")
  @Length(max = 500, message = "退货地址长度不能超过500")
  @TableField(value = "refund_address", condition = LIKE)
  private String refundAddress;

  /**
   * 退货联系电话
   */
  @ApiModelProperty(value = "退货联系电话")
  @Length(max = 32, message = "退货联系电话长度不能超过32")
  @TableField(value = "refund_tel", condition = LIKE)
  private String refundTel;

  /**
   * 退货联系人
   */
  @ApiModelProperty(value = "退货联系人")
  @Length(max = 32, message = "退货联系人长度不能超过32")
  @TableField(value = "refund_contact", condition = LIKE)
  private String refundContact;

  /**
   * 店铺类型:1汽修店，2保养店，3美容店，4贴膜店，5洗车店，6轮胎更换店，7救援店，8加油站
   */
  @ApiModelProperty(value = "店铺类型:1汽修店，2保养店，3美容店，4贴膜店，5洗车店，6轮胎更换店，7救援店，8加油站")
  @NotNull(message = "店铺类型:1汽修店，2保养店，3美容店，4贴膜店，5洗车店，6轮胎更换店，7救援店，8加油站")
  @TableField("store_type")
  private Integer storeType;

  /**
   * 是否自动发送退货地址给买家 0否 1是
   */
  @ApiModelProperty(value = "是否自动发送退货地址给买家 0否 1是")
  @NotNull(message = "是否自动发送退货地址给买家 0否 1是不能为空")
  @TableField("is_auto_send_refund_address")
  private Integer isAutoSendRefundAddress;
  /**
   * 经度
   */
  @ApiModelProperty(value = "经度")
  @TableField("longitude")
  private String longitude;
  /**
   * 纬度
   */
  @ApiModelProperty(value = "纬度")
  @TableField("latitude")
  private String latitude;
  @ApiModelProperty(value = "注册人注册省份")
  @TableField("province")
  private String province;

  @ApiModelProperty(value = "注册人注册市县")
  @TableField("city")
  private String city;

  @ApiModelProperty(value = "注册人注册区")
  @TableField("area")
  private String area;


  @ApiModelProperty(value = "注册人注册省份")
  @TableField("province_code")
  private String provinceCode;

  /**
   * 所在市代码
   */
  @ApiModelProperty(value = "所在市代码")
  @TableField("city_code")
  private String cityCode;


  /**
   * 所在区代码
   */
  @ApiModelProperty(value = "所在区代码")
  @TableField("area_code")
  private String areaCode;

  @ApiModelProperty(value = "地址详情")
  @TableField("address")
  private String address;

  @ApiModelProperty(value = "订单数量")
  @TableField("order_quantity")
  private  Integer orderQuantity;
  /**
   * 到期时间
   */
  @ApiModelProperty(value = "到期时间")
  @TableField("expiration_time")
   @DateTimeFormat(pattern="yyyy-MM-dd")
  @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
  private LocalDateTime expirationTime;
  /**
   * 联系电话
   */
  @ApiModelProperty(value = "联系电话")
  @TableField(value = "telephone", condition = LIKE)
  private String telephone;

  /**
   * 营业时间
   */
  @ApiModelProperty(value = "营业时间")
  @TableField(value = "business_hours", condition = LIKE)
  private String businessHours;
  /**
   * 店面照
   */
  @ApiModelProperty(value = "店面照")
  @TableField(value = "storefront_img", condition = LIKE)
  private String storefrontImg;

  /**
   * 店面背景图
   */
  @ApiModelProperty(value = "背景图")
  @TableField(value = "background_img", condition = LIKE)
  private String backgroundImg;

  /**
   * 营业额
   */
  @ApiModelProperty(value = "营业额")
  @TableField(value = "turnover", condition = LIKE)
  private BigDecimal turnover;
  @TableField(exist = false)
  private Integer userType;
  /**
   * 评分
   */
  @ApiModelProperty(value = "评分")
  @TableField(exist = false)
  private Integer score;

  @ApiModelProperty(value = "1=删除")
  @TableField(value = "is_delete")
  private Integer isDelete;

//  @JsonFormat(shape = JsonFormat.Shape.NUMBER,pattern = "yyyy-MM-dd HH:mm:ss")
//  private Timestamp createTime;
//
//  @JsonFormat(shape = JsonFormat.Shape.NUMBER,pattern = "yyyy-MM-dd HH:mm:ss")
//  private Timestamp updateTime;

  @ApiModelProperty(value = "创建人")
  private Long createUser;

  @ApiModelProperty(value = "更新人")
  private Long updateUser;

}
